home *** CD-ROM | disk | FTP | other *** search
/ Software Explosion / Software Explosion (Fore-Matt Home Computing)(1996).iso / games / windows / hangman / hangman.h < prev    next >
C/C++ Source or Header  |  1996-01-17  |  2KB  |  52 lines

  1. //  CHangman.h
  2. //
  3. //  Jasen N. Tenney
  4. //    21 December 1995
  5. //
  6. //  Header file for CHangman class.
  7. //
  8.  
  9. #ifndef CHANGMAN_H
  10. #define CHANGMAN_H
  11.  
  12. class CHangman
  13. {
  14. protected:
  15.     UINT            m_WordCount;            //Total # words in dictionary
  16.     UINT            m_TotalGuesses;            //Total # of guesses so far
  17.     UINT            m_GamesPlayed;            //Total # of games played so far
  18.     UINT            m_GamesWon;                //Total # of games won
  19.     UINT            m_Percentage;            //Percentage (ie GamesWon / GamesPlayed)
  20.     UINT            m_GuessesRemaining;        //# of guesses left for this round
  21.     UINT            m_NumValidGuesses;        //# of guesses allowed per round
  22.     CStringArray    m_CurrentDictionary;    //All the words in the dictionary
  23.     CString            m_CurrentWord;            //The current word to guess
  24.     CString            m_CurrentGuess;            //The current guess so far
  25.  
  26. protected:
  27.     CString InitCurrentGuess();                //Get a word out of dictionary
  28.  
  29. public:
  30.     CHangman();                                //Constructor
  31.     ~CHangman();                            //Destructor
  32.     BOOL CheckWordCompleted();                //Does m_CurrentGuess match m_CurrentWord
  33.     BOOL CheckLetter(char Letter);            //Check if Letter is in m_CurrentWord
  34.     BOOL LoadDictionary();                    //Load the dictionary from disk
  35.     CString GetCurrentWord();                //Return the current word    
  36.     CString GetHintLetter();                //Return next letter in CurrentWord
  37.     CString GetCurrentGuess();                //Return the current guess so far
  38.     UINT GetTotalGuesses();                    //Return total number of guesses so far
  39.     UINT GetGuessRemain();                    //Return # of guesses remaining
  40.     UINT GetGamesWon();                        //Return # of games won so far
  41.     UINT GetGamesPlayed();                    //Return # of games played so far
  42.     UINT GetPercentage();                    //Return the percentage so far
  43.     void LoadNewWord();                        //Load a new word into m_CurrentWord
  44.     void IncrementTotalGuesses();            //Add one to total guesses
  45.     void DecrementGuessRemain();            //Decrement guesses remaining 
  46.     void IncrementGamesPlayed();            //Increment games played so far
  47.     void IncrementGamesWon();                //Increment games won so far
  48.     void Reset();                            //Reset variables as if new game
  49.     void LoadErrorDictionary();                //If can't load dictionary then do this
  50. };
  51.  
  52. #endif